package cn.net.yugu.doraemon.netty.protocol;

import cn.net.yugu.doraemon.netty.protocol.msg01.Msg011000004;
import cn.net.yugu.doraemon.netty.protocol.msg01.Msg011000005;
import cn.net.yugu.doraemon.netty.protocol.msg01.Msg012000004;
import cn.net.yugu.doraemon.netty.protocol.msg01.Msg012000005;
import cn.net.yugu.doraemon.netty.protocol.msg05.Msg051000001;
import cn.net.yugu.doraemon.netty.protocol.msg05.Msg051000002;
import cn.net.yugu.doraemon.netty.protocol.msg05.Msg052000001;
import cn.net.yugu.doraemon.netty.protocol.msg05.Msg052000002;
import cn.net.yugu.doraemon.netty.protocol.msg06.*;
import cn.net.yugu.doraemon.netty.protocol.msg07.*;
import cn.net.yugu.doraemon.netty.protocol.msg08.*;
import cn.net.yugu.doraemon.netty.protocol.msg21.*;
import cn.net.yugu.doraemon.netty.protocol.msg22.*;
import cn.net.yugu.doraemon.netty.protocol.msg23.Msg231000001;
import cn.net.yugu.doraemon.netty.protocol.msg23.Msg232000001;
import cn.net.yugu.doraemon.netty.protocol.msg24.Msg241000001;
import cn.net.yugu.doraemon.netty.protocol.msg24.Msg241000002;
import cn.net.yugu.doraemon.netty.protocol.msg91.*;
import cn.net.yugu.doraemon.netty.protocol.msg92.*;
import cn.net.yugu.doraemon.netty.protocol.msg93.*;

import java.util.HashMap;
import java.util.Map;

public enum MsgCode {
    /**
     * 匹配对象.
     */
    MSG_011000004(11000004, Msg011000004.class),
    MSG_011000005(11000005, Msg011000005.class),

    MSG_012000004(12000004, Msg012000004.class),
    MSG_012000005(12000005, Msg012000005.class),

    MSG_211000001(211000001, Msg211000001.class),
    MSG_211000002(211000002, Msg211000002.class),
    MSG_211000003(211000003, Msg211000003.class),

    MSG_212000001(212000001, Msg212000001.class),
    MSG_212000002(212000002, Msg212000002.class),
    MSG_212000003(212000003, Msg212000003.class),

    MSG_221000004(221000004, Msg221000004.class),
    MSG_221000005(221000005, Msg221000005.class),
    MSG_221000006(221000006, Msg221000006.class),
    MSG_221000007(221000007, Msg221000007.class),
    MSG_221000008(221000008, Msg221000008.class),
    MSG_221000009(221000009, Msg221000009.class),
    MSG_221000010(221000010, Msg221000010.class),

    MSG_222000004(222000004, Msg222000004.class),
    MSG_222000005(222000005, Msg222000005.class),
    MSG_222000006(222000006, Msg222000006.class),
    MSG_222000007(222000007, Msg222000007.class),
    MSG_222000008(222000008, Msg222000008.class),
    MSG_222000009(222000009, Msg222000009.class),
    MSG_222000010(222000010, Msg222000010.class),

    MSG_231000001(231000001, Msg231000001.class),
    MSG_232000001(232000001, Msg232000001.class),

    MSG_241000001(241000001, Msg241000001.class),
    MSG_241000002(241000002, Msg241000002.class),

    MSG_051000001(51000001, Msg051000001.class),
    MSG_051000002(51000002, Msg051000002.class),
    MSG_052000001(52000001, Msg052000001.class),
    MSG_052000002(52000002, Msg052000002.class),

    MSG_061000001(61000001, Msg061000001.class),
    MSG_061000002(61000002, Msg061000002.class),
    MSG_061000003(61000003, Msg061000003.class),
    MSG_062000001(62000001, Msg062000001.class),
    MSG_062000002(62000002, Msg062000002.class),
    MSG_062000003(62000003, Msg062000003.class),

    MSG_071000001(71000001, Msg071000001.class),
    MSG_071000002(71000002, Msg071000002.class),
    MSG_071000003(71000003, Msg071000003.class),
    MSG_071000004(71000004, Msg071000004.class),
    MSG_071000005(71000005, Msg071000005.class),
    MSG_071000006(71000006, Msg071000006.class),
    MSG_071000007(71000007, Msg071000007.class),
    MSG_071000008(71000008, Msg071000008.class),
    MSG_071000009(71000009, Msg071000009.class),
    MSG_071000011(71000011, Msg071000011.class),

    MSG_072000001(72000001, Msg072000001.class),
    MSG_072000002(72000002, Msg072000002.class),
    MSG_072000003(72000003, Msg072000003.class),
    MSG_072000004(72000004, Msg072000004.class),
    MSG_072000005(72000005, Msg072000005.class),
    MSG_072000006(72000006, Msg072000006.class),
    MSG_072000007(72000007, Msg072000007.class),
    MSG_072000008(72000008, Msg072000008.class),
    MSG_072000009(72000009, Msg072000009.class),

    MSG_081000001(81000001, Msg081000001.class),
    MSG_081000002(81000002, Msg081000002.class),
    MSG_081000003(81000003, Msg081000003.class),
    MSG_081000004(81000004, Msg081000004.class),
    MSG_081000005(81000005, Msg081000005.class),
    MSG_081000006(81000006, Msg081000006.class),
    MSG_081000007(81000007, Msg081000007.class),
    MSG_081000008(81000008, Msg081000008.class),
    MSG_081000009(81000009, Msg081000009.class),
    MSG_081000010(81000010, Msg081000010.class),
    MSG_081000011(81000011, Msg081000011.class),
    MSG_081000012(81000012, Msg081000012.class),
    MSG_081000013(81000013, Msg081000013.class),
    MSG_081000014(81000014, Msg081000014.class),
    MSG_081000015(81000015, Msg081000015.class),
    MSG_081000016(81000016, Msg081000016.class),
    MSG_081000017(81000017, Msg081000017.class),
    MSG_081000018(81000018, Msg081000018.class),

    MSG_082000001(82000001, Msg082000001.class),
    MSG_082000002(82000002, Msg082000002.class),
    MSG_082000003(82000003, Msg082000003.class),
    MSG_082000004(82000004, Msg082000004.class),
    MSG_082000005(82000005, Msg082000005.class),
    MSG_082000006(82000006, Msg082000006.class),
    MSG_082000007(82000007, Msg082000007.class),
    MSG_082000008(82000008, Msg082000008.class),
    MSG_082000009(82000009, Msg082000009.class),
    MSG_082000010(82000010, Msg082000010.class),
    MSG_082000011(82000011, Msg082000011.class),
    MSG_082000012(82000012, Msg082000012.class),
    MSG_082000013(82000013, Msg082000013.class),
    MSG_082000014(82000014, Msg082000014.class),
    MSG_082000015(82000015, Msg082000015.class),
    MSG_082000016(82000016, Msg082000016.class),
    MSG_082000017(82000017, Msg082000017.class),
    MSG_082000018(82000018, Msg082000018.class),

    MSG_911000001(911000001, Msg911000001.class),
    MSG_911000002(911000002, Msg911000002.class),
    MSG_911000003(911000003, Msg911000003.class),
    MSG_911000007(911000007, Msg911000007.class),
    MSG_911000008(911000008, Msg911000008.class),
    MSG_911000009(911000009, Msg911000009.class),
    MSG_911000010(911000010, Msg911000010.class),

    MSG_912000001(912000001, Msg912000001.class),
    MSG_912000002(912000002, Msg912000002.class),
    MSG_912000003(912000003, Msg912000003.class),
    MSG_912000007(912000007, Msg912000007.class),
    MSG_912000008(912000008, Msg912000008.class),
    MSG_912000009(912000009, Msg912000009.class),

    MSG_921000002(921000002, Msg921000002.class),
    MSG_921000003(921000003, Msg921000003.class),
    MSG_921000004(921000004, Msg921000004.class),
    MSG_921000008(921000008, Msg921000008.class),
    MSG_921000012(921000012, Msg921000012.class),
    MSG_921000015(921000015, Msg921000015.class),
    MSG_921000017(921000017, Msg921000017.class),
    MSG_921000018(921000018, Msg921000018.class),
    MSG_921000021(921000021, Msg921000021.class),
    MSG_921000022(921000022, Msg921000022.class),
    MSG_921000023(921000023, Msg921000023.class),
    MSG_921000024(921000024, Msg921000024.class),
    MSG_921000025(921000025, Msg921000025.class),
    MSG_921000026(921000026, Msg921000026.class),
    MSG_921000027(921000027, Msg921000027.class),
    MSG_921000029(921000029, Msg921000029.class),
    MSG_921000030(921000030, Msg921000030.class),

    MSG_922000002(922000002, Msg922000002.class),
    MSG_922000003(922000003, Msg922000003.class),
    MSG_922000004(922000004, Msg922000004.class),
    MSG_922000008(922000008, Msg922000008.class),
    MSG_922000012(922000012, Msg922000012.class),
    MSG_922000015(922000015, Msg922000015.class),
    MSG_922000017(922000017, Msg922000017.class),
    MSG_922000018(922000018, Msg922000018.class),
    MSG_922000021(922000021, Msg922000021.class),
    MSG_922000022(922000022, Msg922000022.class),
    MSG_922000023(922000023, Msg922000023.class),
    MSG_922000024(922000024, Msg922000024.class),
    MSG_922000025(922000025, Msg922000025.class),
    MSG_922000026(922000026, Msg922000026.class),
    MSG_922000027(922000027, Msg922000027.class),
    MSG_922000028(922000028, Msg922000028.class),
    MSG_922000029(922000029, Msg922000029.class),
    MSG_922000030(922000030, Msg922000030.class),

    MSG_931000001(931000001, Msg931000001.class),
    MSG_931000003(931000003, Msg931000003.class),
    MSG_931000007(931000007, Msg931000007.class),
    MSG_931000008(931000008, Msg931000008.class),
    MSG_931000009(931000009, Msg931000009.class),
    MSG_931000010(931000010, Msg931000010.class),
    MSG_931000099(931000099, Msg931000099.class),

    MSG_932000001(932000001, Msg932000001.class),
    MSG_932000003(932000003, Msg932000003.class),
    MSG_932000007(932000007, Msg932000007.class),
    MSG_932000008(932000008, Msg932000008.class),
    MSG_932000009(932000009, Msg932000009.class),
    MSG_932000010(932000010, Msg932000010.class),
    MSG_932000099(932000099, Msg932000099.class),

    ;

    private static Map<Integer, Class> map = new HashMap<>();
    static {
        for(MsgCode e : MsgCode.values()) {
            map.put(e.code, e.clazz);
        }
    }

    private final int code;
    private final Class clazz;

    MsgCode(int code, Class clazz) {
        this.code = code;
        this.clazz = clazz;
    }

    public final int getCode() {
        return code;
    }

    public static Class get(int code) {
        return map.get(code);
    }
}
